#include "binaryTree.h"

int compareFnuc(void *arg1, void *arg2)
{
    int data1 = *(int *)arg1;
    int data2 = *(int *)arg2;

    return data1 - data2;
}

void printFunc(void *arg)
{
    int data = *(int *)arg;
    printf("data:%d\t", data);
}

int main()
{
    BinaryTree mytree(compareFnuc, printFunc);

    int array[] = {15, 24, 9, 17, 63, 71, 11, 2};
    int length = sizeof(array) / sizeof(array[0]);
    for (int idx = 0; idx < length; idx++)
    {
        mytree.insertData(&array[idx]);
    }
    /*层序遍历 */
mytree.levelTravel();
printf("\n");

mytree.deleteData(&array[0]);
/*层序遍历 */
mytree.levelTravel();
printf("\n");

mytree.deleteData(&array[2]);
/*层序遍历 */
mytree.levelTravel();
printf("\n");




}